Skip to content

fix(venv): preserve custom prompt when reusing existing venv#30

Merged
benbenbang merged 1 commit into
mainfrom
fix/bugbug
Mar 30, 2026
Merged

fix(venv): preserve custom prompt when reusing existing venv#30
benbenbang merged 1 commit into
mainfrom
fix/bugbug

Conversation

@benbenbang

Copy link
Copy Markdown
Owner

This commit fixes an issue where custom prompts set during virtual environment creation were being overwritten when reusing an existing venv. The prompt update logic now only runs when a new venv is created or recreated.

Prompt preservation logic:

  • Modified the prompt update condition in src/main.rs to check both needs_create and !has_custom_prompt before updating the prompt, ensuring that existing venvs with custom prompts (set via --prompt or --prefix) are left untouched when reused.
  • Added clarifying comments explaining that reusing an existing venv preserves the pyvenv.cfg file and any prompt configuration from the original creation.

This commit fixes an issue where custom prompts set during virtual environment creation were being overwritten when reusing an existing venv. The prompt update logic now only runs when a new venv is created or recreated.

**Prompt preservation logic:**
* Modified the prompt update condition in `src/main.rs` to check both `needs_create` and `!has_custom_prompt` before updating the prompt, ensuring that existing venvs with custom prompts (set via --prompt or --prefix) are left untouched when reused.
* Added clarifying comments explaining that reusing an existing venv preserves the pyvenv.cfg file and any prompt configuration from the original creation.
@benbenbang
benbenbang enabled auto-merge (squash) March 30, 2026 17:00
@github-actions github-actions Bot added enhancement New feature or request triage labels Mar 30, 2026
@benbenbang
benbenbang merged commit 68d5cd3 into main Mar 30, 2026
2 checks passed
@benbenbang
benbenbang deleted the fix/bugbug branch March 30, 2026 17:01
@ptah-technical-app

Copy link
Copy Markdown

🎉 This PR is included in version 2.6.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant